Changes check for "udev", so that it works on debian sid (that does not
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Mon, 21 Nov 2005 16:03:21 +0000 (17:03 +0100)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Mon, 21 Nov 2005 16:03:21 +0000 (17:03 +0100)
have /sbin/udev anymore).

Signed-off-by: Murillo F. Bernardes <mfb@br.ibm.com>
install.sh
tools/check/check_hotplug

index 46e22abe6c1e6f05728bf82ea33c542453f39a39..e7dbfc24b63d31b49c7c5179a9d41e0c5b61823f 100755 (executable)
@@ -27,7 +27,10 @@ echo "Installing Xen from '$src' to '$dst'..."
 cp -fdRL $src/etc/init.d/* $dst/etc/init.d/
 echo "All done."
 
-if [ -x /sbin/udev ] && [ ! -z `/sbin/udev -V` ] && [ `/sbin/udev -V` -ge 059 ]; then
+[ -x "$(which udevinfo)" ] && \
+  UDEV_VERSION=$(udevinfo -V | sed -e 's/^.*\s\([0-9]\+\)[^0-9]*/\1/')
+
+if [ -n "$UDEV_VERSION" ] && [ $UDEV_VERSION -ge 059 ]; then
   cp -f $src/etc/udev/rules.d/*.rules $dst/etc/udev/rules.d/
 else
   cp -f $src/etc/hotplug/*.agent $dst/etc/hotplug/
index 61feb4c6a6e976183cfcf44574c112559e668818..aaedb767bf24b45e212d57a5c5f2fe9c724d52cd 100644 (file)
@@ -6,8 +6,10 @@ function error {
    echo '  *** Check for the hotplug scripts (hotplug) FAILED'
    exit 1
 }
+[ -x "$(which udevinfo)" ] && \
+  UDEV_VERSION=$(udevinfo -V | sed -e 's/^.*\s\([0-9]\+\)[^0-9]*/\1/')
 
-if [ -x /sbin/udev ] && [ ! -z `/sbin/udev -V` ] && [ `/sbin/udev -V` -ge 059 ]; then
+if [ -n "$UDEV_VERSION" ] && [ $UDEV_VERSION -ge 059 ]; then
   exit 0
 fi